package p7;

/**
 * @author krystal
 * @date 2022/11/11 20:29
 */
//子类和父类不存在同名成员变量
class Base{
    int a = 1;
    int b = 2;
}

class Derived extends Base{
    int c = 3;
    int d = 4;

    public void test(){
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
    }
}

public class Demo3 {
    public static void main(String[] args) {
        Derived derived=new Derived();
        derived.test();
    }
}
